package j52;

import java.util.concurrent.*;

/**
 * @author chengshuai
 * @date 2021/4/18 11:02
 */
public class Test {

    public static void main(String[] args) {

        //更改通过这种方式去创建，便于明白线程池底层原理
        ThreadPoolExecutor poolExecutor = new ThreadPoolExecutor(1, 1,
                0L, TimeUnit.MICROSECONDS,
                new LinkedBlockingQueue<>());

        //其实这两种达到的效果是一样的
        ExecutorService threadPool = Executors.newSingleThreadExecutor();
    }
}
